Page({
  data: {
    swiperH:'',
    nowIdx:0,
    imgList:[
      'https://p0.pipi.cn/mmdb/fb7386333393399257b12d2bdf368cb769813.jpg?imageMogr2/thumbnail/2500x2500%3E',
      'https://p0.pipi.cn/mmdb/fb738633537f2a9235c7ed11e14a265302a9b.jpg?imageMogr2/thumbnail/2500x2500%3E',
      'https://p0.pipi.cn/mmdb/fb738633537f2a8ea38ea34efb781c44a0ea1.jpg?imageMogr2/thumbnail/2500x2500%3E',
      'https://p0.pipi.cn/mmdb/fb738633537ddd06d6b535b5b7e208afc817f.jpg?imageMogr2/thumbnail/2500x2500%3E',
      'https://p0.pipi.cn/mmdb/fb7386333393399257b12d2bdf368cb769813.jpg?imageMogr2/thumbnail/2500x2500%3E',
      'https://p0.pipi.cn/mmdb/fb738633537f2a9235c7ed11e14a265302a9b.jpg?imageMogr2/thumbnail/2500x2500%3E',
      'https://p0.pipi.cn/mmdb/fb738633537f2a8ea38ea34efb781c44a0ea1.jpg?imageMogr2/thumbnail/2500x2500%3E',
      'https://p0.pipi.cn/mmdb/fb738633537ddd06d6b535b5b7e208afc817f.jpg?imageMogr2/thumbnail/2500x2500%3E'
    ]
  },
  //获取swiper高度
  getHeight:function(e){
    var winWid = wx.getSystemInfoSync().windowWidth - 2*100;//获取当前屏幕的宽度
    var imgh = e.detail.height;//图片高度
    var imgw = e.detail.width;
    var sH = winWid * imgh / imgw + "px"
    this.setData({
      swiperH: sH
    })
  },
  //swiper滑动事件
  swiperChange:function(e){
    this.setData({
      nowIdx: e.detail.current
    })
  },
  toggle(e) {
    this.setData({
      nowIdx: e.target.dataset.index
    })
  }
})
